package com.ruoyi.system.business;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSONObject;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author
 * @Date
 */
public class HttpController {


    private static void httpGet(){
        String url = "http://localhost/dev-api/system/user/list";
        String authorization = "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImMxMjk1M2UwLTQyNzYtNGFkYS05YzAwLWM4ZTFmZmNhNjM0NCJ9.-V_ncSdAtYd8FTOOm1WmGRgpFS8unGONajJQsA1hOavYSYYIC67XCjLgadxxipLoZf-UW_j7MiIYgZyIlzrWJA";
        Map<String, Object> param = new HashMap<String, Object>();
        param.put("pageNum",1);
        param.put("pageSize",5);
        String body = HttpRequest.get(url)
                // .header(Header.AUTHORIZATION, authorization)
                .form(param)
                .execute()
                .body();

        System.out.println(body);
    }

    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        JSONObject json2 = new JSONObject();
        json2.put("name","name");
        json2.put("age","name");
        jsonObject.put("json", json2);
        Object byPath = jsonObject.getByPath("json.agea");
        System.out.println(byPath);
    }

}
